//package com.google.code.jmarias.client.bot;
//
//import com.google.code.jmarias.common.Card;
//import com.google.code.jmarias.common.Suit;
//import com.google.code.jmarias.common.Value;
//import com.google.code.jmarias.common.action.DealSevenCardsAction;
//import com.google.code.jmarias.common.action.DropTalonAction;
//import com.google.code.jmarias.common.action.GameAction;
//import java.io.FileReader;
//import javax.script.Invocable;
//import javax.script.ScriptEngine;
//import javax.script.ScriptEngineManager;
//import javax.script.ScriptException;
//
///**
// *
// * @author Ondrej Michal
// */
//public class ScriptingEngine {
//
//    public static void main(String[] args) throws Exception {
//        ScriptEngineManager manager = new ScriptEngineManager();
//        ScriptEngine engine = manager.getEngineByName("JavaScript");
//
//        // evaluate a script string. The script accesses "file"
//        // variable and calls method on it
//        engine.eval(new FileReader("/home/ondra/jmarias-backup-localcopy/jmarias/client/src/main/resources/bot.js"));
//
//        Invocable inv = (Invocable) engine;
//
//        // invoke the global function named "hello"
//        DealSevenCardsAction action = new DealSevenCardsAction(new Card[]{new Card(Suit.leaves, Value.ace), new Card(Suit.acorns, Value.ace), new Card(Suit.leaves, Value.ace), new Card(Suit.hearts, Value.ace), new Card(Suit.acorns, Value.ace), new Card(Suit.hearts, Value.overKnave), new Card(Suit.hearts, Value.value7)});
//
//
//    }
//
//    public static void processAction(Invocable inv, GameAction action) throws ScriptException, NoSuchMethodException {
//        if (action instanceof DealSevenCardsAction) {
//            Object result = inv.invokeFunction("pickTrump", action);
//            System.out.println("java: uzivatel vybral za trumf " + result);
//        } else if (action instanceof DropTalonAction) {
//            Object result = inv.invokeFunction("dropTalon", action);
//            System.out.println("java: uzivatel odhodil talon " + result);
//        }
//    }
//}
